Skip to content

feat(cloudflare): add KV Instant namespaces with local emulation - #2027

Draft
BlankParticle wants to merge 5 commits into
mainfrom
blank/add-kv-instant-namespace
Draft

BlankParticle wants to merge 5 commits into
mainfrom
blank/add-kv-instant-namespace

Conversation

@BlankParticle

@BlankParticle BlankParticle commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Cloudflare.KV.InstantNamespace adds Workers KV Instant for small, frequently read configuration, with persistent local emulation during alchemy dev.

const config = yield* Cloudflare.KV.InstantNamespace("Config");

const worker = yield* Cloudflare.Worker("App", {
  main: "./src/worker.ts",
  env: { CONFIG: config },
});

Existing KV capabilities also accept Instant namespaces:

const client = yield* Cloudflare.KV.ReadNamespace(config);
const enabled = yield* client.get("feature-enabled");
const keys = yield* client.list({ prefix: "feature-" });

Provide ReadNamespaceBinding on the Worker runtime, as with classic KV. Instant clients exclude metadata and pagination options; local emulation enforces the 300-byte UTF-8 key limit but does not emulate storage quotas or write throttling. Switching between classic and Instant replaces the namespace without migrating its data.

Local integration and runtime KV checks pass. Live behavior is untested. Live tests require CLOUDFLARE_TEST_KV_INSTANT=1; this PR remains draft pending verification.

@alchemy-version-bot

alchemy-version-bot Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Install the packages built from this commit:

alchemy

pnpm install https://pkg.alchemy.run/alchemy/pr:2027:425e06b
@alchemy.run (6)
pnpm install https://pkg.alchemy.run/@alchemy.run/better-auth/pr:2027:425e06b
pnpm install https://pkg.alchemy.run/@alchemy.run/cloudflare-runtime/pr:2027:425e06b
pnpm install https://pkg.alchemy.run/@alchemy.run/frontend-frameworks/pr:2027:425e06b
pnpm install https://pkg.alchemy.run/@alchemy.run/node-utils/pr:2027:425e06b
pnpm install https://pkg.alchemy.run/@alchemy.run/floci/pr:2027:425e06b
pnpm install https://pkg.alchemy.run/@alchemy.run/pkg/pr:2027:425e06b
Transitive Dependencies (19)
pnpm install https://pkg.alchemy.run/@distilled.cloud/acme/pr:2027:425e06b
pnpm install https://pkg.alchemy.run/@distilled.cloud/aws/pr:2027:425e06b
pnpm install https://pkg.alchemy.run/@distilled.cloud/axiom/pr:2027:425e06b
pnpm install https://pkg.alchemy.run/@distilled.cloud/cloudflare/pr:2027:425e06b
pnpm install https://pkg.alchemy.run/@distilled.cloud/core/pr:2027:425e06b
pnpm install https://pkg.alchemy.run/@distilled.cloud/doppler/pr:2027:425e06b
pnpm install https://pkg.alchemy.run/@distilled.cloud/fly-io/pr:2027:425e06b
pnpm install https://pkg.alchemy.run/@distilled.cloud/gcp/pr:2027:425e06b
pnpm install https://pkg.alchemy.run/@distilled.cloud/hetzner/pr:2027:425e06b
pnpm install https://pkg.alchemy.run/@distilled.cloud/iceberg/pr:2027:425e06b
pnpm install https://pkg.alchemy.run/@distilled.cloud/infisical/pr:2027:425e06b
pnpm install https://pkg.alchemy.run/@distilled.cloud/neon/pr:2027:425e06b
pnpm install https://pkg.alchemy.run/@distilled.cloud/planetscale/pr:2027:425e06b
pnpm install https://pkg.alchemy.run/@distilled.cloud/prisma/pr:2027:425e06b
pnpm install https://pkg.alchemy.run/@distilled.cloud/railway/pr:2027:425e06b
pnpm install https://pkg.alchemy.run/@distilled.cloud/stripe/pr:2027:425e06b
pnpm install https://pkg.alchemy.run/@distilled.cloud/turso/pr:2027:425e06b
pnpm install https://pkg.alchemy.run/@distilled.cloud/zerossl/pr:2027:425e06b
pnpm install https://pkg.alchemy.run/@distilled.cloud/github/pr:2027:425e06b

Published Oct 9, 2026, 12:53 PM UTC. Expires Oct 16, 2026, 12:53 PM UTC, extended while this pull request is open.

@BlankParticle
BlankParticle force-pushed the blank/add-kv-instant-namespace branch from f5c21c0 to 74128a9 Compare October 9, 2026 11:26
@BlankParticle
BlankParticle force-pushed the blank/add-kv-instant-namespace branch from 5c8c4a2 to 425e06b Compare October 9, 2026 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant